﻿<Window x:Class="CC.Hearts.OptionsWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="CC.Hearts Screensaver - Settings" Height="360" Width="420" WindowStyle="None" ResizeMode="NoResize" AllowsTransparency="True" Opacity="1" Visibility="Visible" Background="Transparent" WindowStartupLocation="CenterScreen" ShowInTaskbar="True" Icon="{StaticResource HeartImage}">
    <Window.Resources>
        <Style x:Key="OptionsButton" TargetType="{x:Type Button}">
            <Setter Property="Height" Value="24"></Setter>
            <Setter Property="HorizontalAlignment" Value="Right"></Setter>
            <Setter Property="Margin" Value="0"></Setter>
            <Setter Property="VerticalAlignment" Value="Bottom"></Setter>
            <Setter Property="Width" Value="69"></Setter>
        </Style>

        <Style x:Key="OptionsColumnDefinitionStyle_Button" TargetType="{x:Type ColumnDefinition}">
            <Setter Property="Width" Value="75"></Setter>
        </Style>

        <Style x:Key="OptionsColumnDefinitionStyle_Label" TargetType="{x:Type ColumnDefinition}">
            <Setter Property="Width" Value="122"></Setter>
        </Style>

        <Style x:Key="OptionsColumnDefinitionStyle_Value" TargetType="{x:Type ColumnDefinition}">
            <Setter Property="Width" Value="62"></Setter>
        </Style>

        <Style x:Key="OptionsSliderStyle" TargetType="{x:Type Slider}">
            <Setter Property="Grid.Column" Value="1"/>
            <Setter Property="HorizontalAlignment" Value="Stretch"></Setter>
            <Setter Property="IsSnapToTickEnabled" Value="True" />
            <Setter Property="Margin" Value="10,2,10,2"></Setter>
            <Setter Property="TickPlacement" Value="BottomRight"/>
            <Setter Property="VerticalAlignment" Value="Center"></Setter>
        </Style>
    </Window.Resources>
    
    <Window.CacheMode>
        <BitmapCache EnableClearType="True" RenderAtScale="1" SnapsToDevicePixels="True"></BitmapCache>
    </Window.CacheMode>
    
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="30"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="30"/>
        </Grid.RowDefinitions>
        
        <!-- BEGIN: Header -->
        <Border Style="{StaticResource DefaultBorderStyle}" Name="_Border" MouseLeftButtonDown="_Border_MouseLeftButtonDown" Grid.Row="0">
            <Grid Margin="5,0">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="16"></ColumnDefinition>
                    <ColumnDefinition Width="*"></ColumnDefinition>
                    <ColumnDefinition Width="16"></ColumnDefinition>
                </Grid.ColumnDefinitions>
                
                <Image Source="{StaticResource HeartImage}" Height="16" Width="16" Grid.Column="0" HorizontalAlignment="Center" VerticalAlignment="Center"></Image>
                <TextBlock Style="{StaticResource DefaultTextBlockStyle}" Grid.Column="1" Margin="5,2,5,2" Text="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Window}}, Path=Title}" VerticalAlignment="Center" />
                <Button Name="_ButtonClose" Content="X" Grid.Column="2" HorizontalAlignment="Right" VerticalAlignment="Center" FontSize="7" Width="16" Height="16" Padding="0" Click="_ButtonClose_Click" IsTabStop="False" />
            </Grid>
        </Border>
        <!-- END: Header -->

        <!-- BEGIN: Content -->
        <Border Style="{StaticResource DefaultBorderStyle}" Grid.Row="1" Padding="10" >
            <DockPanel LastChildFill="True">
                <!-- BEGIN: Frames Per Second -->
                <Border Style="{StaticResource RowBorderStyle}" Name="_BorderFramesPerSecond">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Style="{StaticResource OptionsColumnDefinitionStyle_Label}"></ColumnDefinition>
                            <ColumnDefinition Width="*"></ColumnDefinition>
                            <ColumnDefinition Style="{StaticResource OptionsColumnDefinitionStyle_Value}"></ColumnDefinition>
                        </Grid.ColumnDefinitions>

                        <TextBlock Style="{StaticResource DefaultTextBlockStyle}" Name="_TextBlockFramesPerSecondLabel" Text="Frames / second:" Grid.Column="0" />
                        <Slider Style="{StaticResource OptionsSliderStyle}" Name="_SliderFramesPerSecond" LargeChange="10" Maximum="60" Minimum="30" SmallChange="5" Value="45" ValueChanged="_SliderFramesPerSecond_ValueChanged" TickFrequency="5" />
                        <TextBlock Style="{StaticResource DefaultTextBlockStyle}" Name="_TextBlockFramesPerSecondValue" Text="45" Grid.Column="2" HorizontalAlignment="Center" />
                    </Grid>
                </Border>
                <!-- END: Frames Per Second -->

                <!-- BEGIN: Animation Speed -->
                <Border Style="{StaticResource RowBorderStyle}" Name="_BorderAnimationSpeed">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Style="{StaticResource OptionsColumnDefinitionStyle_Label}"></ColumnDefinition>
                            <ColumnDefinition Width="*"></ColumnDefinition>
                            <ColumnDefinition Style="{StaticResource OptionsColumnDefinitionStyle_Value}"></ColumnDefinition>
                        </Grid.ColumnDefinitions>

                        <TextBlock Style="{StaticResource DefaultTextBlockStyle}" Name="_TextBlockAnimationSpeedLabel" Text="Animation Speed:" Grid.Column="0" />
                        <Slider Style="{StaticResource OptionsSliderStyle}" Name="_SliderAnimationSpeed" LargeChange="1" Maximum="2" Minimum="0" SmallChange="1" Value="1" ValueChanged="_SliderAnimationSpeed_ValueChanged" />
                        <TextBlock Style="{StaticResource DefaultTextBlockStyle}" Name="_TextBlockAnimationSpeedValue" Text="Normal" Grid.Column="2" HorizontalAlignment="Center" />
                    </Grid>
                </Border>
                <!-- END: Animation Speed -->

                <!-- BEGIN: Maximum Hearts -->
                <Border Style="{StaticResource RowBorderStyle}" Name="_BorderMaximumHearts">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Style="{StaticResource OptionsColumnDefinitionStyle_Label}"></ColumnDefinition>
                            <ColumnDefinition Width="*"></ColumnDefinition>
                            <ColumnDefinition Style="{StaticResource OptionsColumnDefinitionStyle_Value}"></ColumnDefinition>
                        </Grid.ColumnDefinitions>

                        <TextBlock Style="{StaticResource DefaultTextBlockStyle}" Name="_TextBlockMaximumHeartsLabel" Text="Maximum Hearts:" Grid.Column="0" />
                        <Slider Style="{StaticResource OptionsSliderStyle}" Name="_SliderMaximumHearts" LargeChange="10" Maximum="50" Minimum="10" SmallChange="5" Value="30" ValueChanged="_SliderMaximumHearts_ValueChanged" TickFrequency="5" />
                        <TextBlock Style="{StaticResource DefaultTextBlockStyle}" Name="_TextBlockMaximumHeartsValue" Text="30" Grid.Column="2" HorizontalAlignment="Center" />
                    </Grid>
                </Border>
                <!-- END: Maximum Hearts -->

                <!-- BEGIN: Minimum Size -->
                <Border Style="{StaticResource RowBorderStyle}" Name="_BorderScale">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Style="{StaticResource OptionsColumnDefinitionStyle_Label}"></ColumnDefinition>
                            <ColumnDefinition Width="*"></ColumnDefinition>
                            <ColumnDefinition Style="{StaticResource OptionsColumnDefinitionStyle_Value}"></ColumnDefinition>
                        </Grid.ColumnDefinitions>

                        <TextBlock Style="{StaticResource DefaultTextBlockStyle}" Name="_TextBlockScaleLabel" Text="Minimum Size:" Grid.Column="0" />
                        <Slider Style="{StaticResource OptionsSliderStyle}" Name="_SliderScale" LargeChange="5" Maximum="9" Minimum="5" SmallChange="1" Value="7" ValueChanged="_SliderScale_ValueChanged" />
                        <TextBlock Style="{StaticResource DefaultTextBlockStyle}" Name="_TextBlockScaleValue" Text="7%" Grid.Column="2" HorizontalAlignment="Center" />
                    </Grid>
                </Border>
                <!-- END: Minimum Size -->

                <!-- BEGIN: Status / Help  -->
                <Border Style="{StaticResource RowBorderStyle}">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*"></ColumnDefinition>
                            <ColumnDefinition Width="*"></ColumnDefinition>
                        </Grid.ColumnDefinitions>

                        <CheckBox Style="{StaticResource DefaultCheckBoxStyle}" Name="_CheckBoxShowStatus" Content="Show status info" Grid.Column="0" HorizontalAlignment="Left" Checked="_CheckBox_Checked" Unchecked="_CheckBox_Checked"></CheckBox>
                        <CheckBox Style="{StaticResource DefaultCheckBoxStyle}" Name="_CheckBoxShowHelp" Content="Show help at startup" Grid.Column="1" HorizontalAlignment="Right" Checked="_CheckBox_Checked" Unchecked="_CheckBox_Checked" />
                    </Grid>
                </Border>
                <!-- END: Status / Help -->

                <!-- BEGIN: Buttons -->
                <Grid DockPanel.Dock="Top">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Style="{StaticResource OptionsColumnDefinitionStyle_Button}"></ColumnDefinition>
                        <ColumnDefinition Width="*"></ColumnDefinition>
                        <ColumnDefinition Style="{StaticResource OptionsColumnDefinitionStyle_Button}"></ColumnDefinition>
                        <ColumnDefinition Style="{StaticResource OptionsColumnDefinitionStyle_Button}"></ColumnDefinition>
                        <ColumnDefinition Style="{StaticResource OptionsColumnDefinitionStyle_Button}"></ColumnDefinition>
                    </Grid.ColumnDefinitions>

                    <Button Style="{StaticResource OptionsButton}" Name="_ButtonDefaults" Grid.Column="0" HorizontalAlignment="Left" Click="_ButtonDefaults_Click">Defaults</Button>
                    <Button Style="{StaticResource OptionsButton}" Name="_ButtonOk" Grid.Column="2" Click="_ButtonOk_Click">OK</Button>
                    <Button Style="{StaticResource OptionsButton}" Name="_ButtonCancel" Grid.Column="3" Click="_ButtonClose_Click" IsCancel="True">Cancel</Button>
                    <Button Style="{StaticResource OptionsButton}" Name="_ButtonApply" Grid.Column="4" Click="_ButtonApply_Click" IsDefault="True">Apply</Button>
                </Grid>
                <!-- END: Buttons -->
            </DockPanel>
        </Border>
        <!-- END: Content -->

        <!-- BEGIN: Footer -->
        <Border Style="{StaticResource DefaultBorderStyle}" Grid.Row="2">
            <Grid>
                <TextBlock Style="{StaticResource DefaultTextBlockStyle}" Text="www.ccswe.com" />
                <TextBlock Style="{StaticResource DefaultTextBlockStyle}" HorizontalAlignment="Right" Text="© 2010" />
            </Grid>
        </Border>
        <!-- END: Footer -->
    </Grid>
</Window>
